package gamble.member.command;

import javax.servlet.http.HttpServletRequest;

import gamble.member.dao.MemberDao;
import gamble.member.vo.AddressVO;
import gamble.member.vo.MemberVO;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class MemberController{
	AddressVO av;
	MemberVO mv;
	
	private MemberDao memberDao;
	
	public void setDao(MemberDao memberDao){
		this.memberDao=memberDao;
	}
	
	@RequestMapping("/member.do")
	public String insertMember(){
		memberDao.getInsert(mv);
		return "gamble/member/memberForm2";
	}
	
//	@RequestMapping("/insertMember.do")
//	public String writeSubmit(MemberVO mv){
//		
//		return "redirect:/member.do";
//		
//	}
//	@Override
//	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
//			throws ServletException, IOException {
//		doProcess(req,resp);
//	}
//	
//	@Override
//	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
//			throws ServletException, IOException {
//		doProcess(req,resp);
//		
//	}
//	
//	protected void doProcess(HttpServletRequest req, HttpServletResponse resp)
//	throws ServletException, IOException {
//		String action=req.getParameter("action");
//		String nextPage="";
//		 
//		if(action==null || action.equals("login.do") ){
//			LoginCommand list=new LoginCommand();
//			list.execute(req,resp);
//			nextPage="test/login.jsp";
//
//		}else if(action.equals("writeForm.do")){
//			nextPage="test/writeForm.jsp";
//		}else if(action.equals("writePro.do")){
//			WriteProCommand pro=new WriteProCommand();
//			pro.execute(req,resp);
//			nextPage="test?action=login.do";
//		}else if(action.equals("fileDown.do")){
//			FileDownloadCommand down = new FileDownloadCommand();
//			down.execute(req, resp);
//			nextPage=null;
//		}else if(action.equals("updateForm.do")){
//			UpdateFormCommand update = new UpdateFormCommand();
//			update.execute(req, resp);
//			nextPage="board/updateForm.jsp";
//		}else if(action.equals("updatePro.do")){
//			UpdateProCommand upc=new UpdateProCommand();
//			upc.execute(req, resp);
//			nextPage="board?action=list.do";
//		}else if(action.equals("delete.do")){
//			DeleteCommand del = new DeleteCommand();
//			del.execute(req, resp);
//			nextPage="board?action=list.do";
//		}
//	
//		
//		//응답처리
//		if(nextPage!=null){
//		RequestDispatcher dispatch=
//			req.getRequestDispatcher(nextPage);
//		dispatch.forward(req,resp);
//		}
//     }
	

}
